﻿using IntelligentAgriculture.Contracts.Interface;
using IntelligentAgriculture.WebAPI.Application.Command.PurchaseFormModelCommand;
using MediatR;
using System.Collections.Generic;

namespace IntelligentAgriculture.WebAPI.Application.CommandHandler.PurchaseFormModelCommandHandler
{
	/// <summary>
	/// 养只档案摘要
	/// </summary>
	public class GetSummaryEnumCommandHandler : IRequestHandler<GetSummaryEnumCommand, Results<List<object>>>
	{
		/// <summary>
		/// 构造函数
		/// </summary>
		private readonly IPurchaseFormModelService _purchaseFormModelService;
		public GetSummaryEnumCommandHandler(IPurchaseFormModelService purchaseFormModelService)
		{
			_purchaseFormModelService = purchaseFormModelService;
		}
		/// <summary>
		/// 获取摘要
		/// </summary>
		/// <param name="request"></param>
		/// <param name="cancellationToken"></param>
		/// <returns></returns>
		/// <exception cref="NotImplementedException"></exception>
		public async Task<Results<List<object>>> Handle(GetSummaryEnumCommand request, CancellationToken cancellationToken)
		{
			var list = await _purchaseFormModelService.GetSummaryEnum();
			return Results<List<object>>.DataResult(list);
		}
	}
}
